<?php
session_start();
include"koneksi/koneksi.php";

$result=mysql_query("select count(*) as hasil from admin where
nik='$nomor_induk_karyawan' and password='$pass_word' ") or die (mysql_error());
$row=mysql_fetch_row($result);

if($row[0]=="1")
{

$query_status=mysql_query("select nik,level from admin 
where nik='$nomor_induk_karyawan' ") or die (mysql_error());
$row_status=mysql_fetch_array($query_status);
$hak=$row_status[nik];
$hak2=$row_status[level];
$_SESSION['nomor_induk_karyawan']=$hak;
$_SESSION['level']=$hak2;
session_register("nomor_induk_karyawan");
session_register("level");
session_register("hak");

header("location:admin/index.php");
}
else
{
	echo"
	<script language='javascript'>
   alert('Maaf, Login Anda Salah ?');
   history.back(1);
   </script>";
exit();
}
?>